"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;

var _jsxRuntime = require("react/jsx-runtime");

var _icons = require("@ant-design/icons");

var _proProvider = require("@ant-design/pro-provider");

var _antdV = require("antd-v4");

var _react = _interopRequireDefault(require("react"));

var _container = _interopRequireDefault(require("../../container"));

var DensityIcon = function DensityIcon() {
  var counter = _container.default.useContainer();

  var intl = (0, _proProvider.useIntl)();
  return (0, _jsxRuntime.jsx)(_antdV.Dropdown, {
    overlay: (0, _jsxRuntime.jsx)(_antdV.Menu, {
      selectedKeys: [counter.tableSize],
      onClick: function onClick(_ref) {
        var _counter$setTableSize;

        var key = _ref.key;
        (_counter$setTableSize = counter.setTableSize) === null || _counter$setTableSize === void 0 ? void 0 : _counter$setTableSize.call(counter, key);
      },
      style: {
        width: 80
      },
      items: [{
        key: 'large',
        label: intl.getMessage('tableToolBar.densityLarger', '默认')
      }, {
        key: 'middle',
        label: intl.getMessage('tableToolBar.densityMiddle', '中等')
      }, {
        key: 'small',
        label: intl.getMessage('tableToolBar.densitySmall', '紧凑')
      }]
    }),
    trigger: ['click'],
    children: (0, _jsxRuntime.jsx)(_antdV.Tooltip, {
      title: intl.getMessage('tableToolBar.density', '表格密度'),
      children: (0, _jsxRuntime.jsx)(_icons.ColumnHeightOutlined, {})
    })
  });
};

var _default = /*#__PURE__*/_react.default.memo(DensityIcon);

exports.default = _default;